#pragma once

#include <string>
#include <set>
#include <functional>
#include "Singleton.h"
#include "MsgRouter.h"
#include "agency.h"

class AgencyService
{
public:
    bool Init();

public:
    AgencyService() = default;
    virtual ~AgencyService() = default;

public:
    static AgencyService* Instance()
	{
		return CSingleton<AgencyService>::Instance();
	}

public:
    enum Sence
    {
        ACCESS_LOGIN = 100,
    };
public:
    bool HandleGetAgent(const std::string& agent, std::string&& trans, Sence sence);
    void OnAgencyGet(MsgData&& data);
    inline void ListenOnAgencyGet(Sence sence, std::function<void(stAgency* agency, std::int32_t err_code, std::string&& trans)> listen)
    {
        m_agencyuser_get_listen[sence] = listen;
    }
private:
    std::map<Sence, std::function<void(stAgency* agency, std::int32_t err_code, std::string&& trans)>> m_agencyuser_get_listen;


};










